package main

import (
	"fmt"
	"time"
)

type Book struct {
	Id          int
	Name        string
	Author      string
	PublishTime time.Time
	Ptr         *int
}

func main() {

	book := Book{
		Id:   12,
		Name: "go语言程序设计",
	}
	book.Author = "徐冬成"

	fmt.Println(book.Author)

	// 指针方式
	var ptrBook *Book = &Book{
		Id:          980,
		Name:        "算法",
		Author:      "徐冬成",
		PublishTime: time.Now(),
	}

	ptrBook.Name = "java多线程编程"
	// ptrBook
	fmt.Println(ptrBook.Name)

	// (*ptrBook)
	fmt.Println((*ptrBook).Author)

}
